import request from '@/utils/request'

// 查询工单管理列表
export function listWorkOrder(query) {
  return request({
    url: '/workorder/workOrder/list',
    method: 'get',
    params: query
  })
}

// 查询工单管理详细
export function getWorkOrder(id) {
  return request({
    url: '/workorder/workOrder/' + id,
    method: 'get'
  })
}

// 新增工单管理
export function addWorkOrder(data) {
  return request({
    url: '/workorder/workOrder',
    method: 'post',
    data: data
  })
}

// 修改工单管理
export function updateWorkOrder(data) {
  return request({
    url: '/workorder/workOrder',
    method: 'put',
    data: data
  })
}

// 删除工单管理
export function delWorkOrder(id) {
  return request({
    url: '/workorder/workOrder/' + id,
    method: 'delete'
  })
}

// 导出工单管理
export function exportWorkOrder(query) {
  return request({
    url: '/workorder/workOrder/export',
    method: 'get',
    params: query
  })
}

// 派单
export function sendOrders(data) {
  return request({
    url: '/workorder/workOrder/sendOrders',
    method: 'post',
    data: data
  })
}

// 催办
export function urgeOrder(data) {
  return request({
    url: '/workorder/workOrder/urgeOrder',
    method: 'post',
    data: data
  })
}


// 办结
export function conCludeOrder(data) {
  return request({
    url: '/workorder/workOrder/conCludeOrder',
    method: 'post',
    data: data
  })
}


// 回访
export function returnOrder(data) {
  return request({
    url: '/workorder/workOrder/returnOrder',
    method: 'post',
    data: data
  })
}


// 转交
export function careOrder(data) {
  return request({
    url: '/workorder/workOrder/careOrder',
    method: 'post',
    data: data
  })
}

// 取消
export function chargebackOrder(data) {
  return request({
    url: '/workorder/workOrder/chargebackOrder',
    method: 'post',
    data: data
  })
}


// 挂单
export function suspendOrder(data) {
  return request({
    url: '/workorder/workOrder/suspendOrder',
    method: 'post',
    data: data
  })
}


// 取消挂单
export function endSuspendOrder(data) {
  return request({
    url: '/workorder/workOrder/endSuspendOrder',
    method: 'post',
    data: data
  })
}


// 返修
export function repairOrder(data) {
  return request({
    url: '/workorder/workOrder/repairOrder',
    method: 'post',
    data: data
  })
}


// 退单
export function retreatOrder(data) {
  return request({
    url: '/workorder/workOrder/retreatOrder',
    method: 'post',
    data: data
  })
}

